home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4619 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: newshost.lanl.gov!tanmoy
  2. From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: ANSI C eoln
  5. Date: 05 Feb 1996 05:57:55 GMT
  6. Organization: Los Alamos National Laboratory
  7. Message-ID: <TANMOY.96Feb4225755@qcd.lanl.gov>
  8. References: <4f3aq0$b9k@nic.umass.edu>
  9. NNTP-Posting-Host: qcd.lanl.gov
  10. Mime-Version: 1.0
  11. Content-Type: text
  12. In-reply-to: peerbhai@twain.oit.umass.edu's message of 4 Feb 1996 22:09:04 GMT
  13.  
  14. In article <4f3aq0$b9k@nic.umass.edu> peerbhai@twain.oit.umass.edu
  15. (Imran Peerbhai) writes: 
  16.    What is the ANSI C keyword for eoln?
  17.  
  18. None :-) When you read a text file, the end of line is read as the
  19. character '\n', however it may be represented in the file. Similarly
  20. when you write a text file, writing '\n' terminates the current line
  21. (and _may_ eat up some immediately previous blanks). While writing text
  22. files, one should write a '\n' at the end. 
  23.  
  24. While reading an unknown text files, you cannot assume that the last
  25. character you read before the file ends will be a '\n'. (Sorry,
  26. different languages are different ... just have to get used to it :-) 
  27.  
  28. For binary files, end of line does not make sense (and it did not make
  29. sense in Pascal non-text files either.)
  30.  
  31. Cheers
  32. Tanmoy
  33. --
  34. tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
  35. Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
  36. Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
  37. <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
  38. internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
  39. fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
  40.